<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-2"
 http-equiv="content-type">
  <title></title>
</head>
<body>
<b>General info</b><br>
<br>
System constist of three parts:<br>
<ol>
  <li>MySQL database</li>
  <li>PHP interface for
managing MySQL database</li>
  <li>C languagae daemon</li>
</ol>
The main target for it is making some
actions, when some
rules are meet. Rules are actions are organized in sequences.<br>
<br>
<b>Rules</b><br>
<br>
You can give many rules in one sequence. Daemon logs into specified DB
and executes given SQL. <br>
<br>
If SQL from all rules give any (non empty) results,
actions are executed.<br>
<br>
<b>Actions</b><br>
<br>
SQL text in each action consist of two or more parts:<br>
<ol>
  <li>SQL query with <i>select</i><br>
  </li>
  <li>optional: "{" char and SQL query with
    <i>select</i><br>
  </li>
  <li>"{" char and action</li>
  <li>optional: as many points 3 as required</li>
</ol>
System logs into first specified DB and makes SQL query (like specified
in point 1). <br>
<br>
If you have any logging details in second specified DB and <i>select</i>
after
first "{" char in SQL text, system makes specified <i>select</i> for
each
result returned from point 1<br>
<br>
Each action is done for <i>select</i> results returned from points 1
and 2.
Action can be SQL command or running program on server (can be used for
sending emails and others).<br>
<br>
If you want to force daemon to insert column number x from first select
for any action, use <i>daemon_column</i>x
(<i>daemon_column1</i> for column 1,&nbsp; <i>daemon_column2</i> for
column 2, etc.).
If you want to force daemon to insert column number
x from second select for any action, use <i>daemon2_column</i>x
(<i>daemon2_column1</i> for column 1,&nbsp; <i>daemon2_column2</i> for
column 2, etc.)<br>
<br>
If you want to run program, insert "<i>daemon_run_program
&lt;parameter1&lt;parameter2&lt;</i>".<br>
<br>
<b>Actions - example 1</b><br>
<br>
<i>select txt from a where txt='wartosc'<br>
{<br>
insert into b (bzzz) values ('daemon_column1')<br>
{<br>
insert into b (bzzz) values ('2')</i><br>
<br>
System makes "<i>select txt from a where txt='wartosc</i>'" and for
each result makes<br>
<ol>
  <li>"<i>insert into b (bzzz) values
('daemon_column1')</i>"
(instead of <i>daemon_column1</i> there is entered txt column
values)</li>
  <li>"<i>insert into b (bzzz) values ('2')</i>"</li>
</ol>
<b>Actions - example 2</b><br>
<br>
<i>select * from a where txt='wartosc'<br>
{<br>
&nbsp; daemon_run_program &lt;c:\windows\notepad.exe&lt;d:\ala.txt&lt;</i><br>
<br>
System makes "<i>select * from a where txt='wartosc'</i>" and for each
result
runs <i>c:\windows\notepad.exe</i> with <i>d:\ala.txt</i> parameter<br>
</body>
</html>
